<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			
			/**
			 * 判断浏览器
			 */
			function checkBrowe(){
				var ua=navigator.userAgent.toLowerCase();
				var info={
					ie: /msie/.test(ua) && !/opera/.test(ua),//匹配ie浏览器
					op: /opera/.test(ua),//匹配opera
					sa: /version.*safari/.test(ua),//匹配safari
					ch: /chrome/.test(ua),//匹配Chrome
					ff: /gecko/.test(ua) && !/webkit/.test(ua)//匹配Firefox
					
				};
				console.log(info.ie);
				console.log(info.op);
				console.log(info.sa);
				console.log(info.ch);
			}
			/**
			 * 判断操作系统
			 */
			function xiTong(){
				let isWin=(navigator.userAgent.indexOf("Win")!=-1);
				let isMac=(navigator.userAgent.indexOf("Mac")!=-1);
				let isUnix=(navigator.userAgent.indexOf("X11")!=-1);
				let isLinux=(navigator.userAgent.indexOf("Linux")!=-1);
				console.log(isWin);
				console.log(isMac);
				console.log(isUnix);
				console.log(isLinux);
			}
			/**
			 * 对话框
			 */
			function duihua(){
				//确认对话框
				let result=confirm("帅不帅?");
				console.log(result);
				//提示输入信息
				let info=prompt("请输入你的姓名")
				console.log(info);
			}
			/**
			 * Localtion
			 */
			function getLocationInfo(){
				location.hash="#top";
				let l1=location.href;
				let l2=location.protocol;
				let l3=location.host;
				let l4=location.hostname;
				let l5=location.port;
				let l6=location.pathname;
				let l7=location.search;
				
				
				console.log(l1);
				console.log(l2);
				console.log(l3);
				console.log(l4);
				console.log(l5);
				console.log(l6);
				console.log(l7);
				
				
			}
			getLocationInfo();
		
		</script>
	</body>
</html>
